package com.baomidou.ant.db2.controller;


import com.baomidou.ant.common.Result;
import com.baomidou.ant.db2.entity.Ygzlw;
import com.baomidou.ant.db2.service.IYgzlwService;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author jobob
 * @since 2022-12-01
 */
@RestController
@RequestMapping("/ygzlw")
@DS("slave_1")
public class YgzlwController {
    @Autowired
    IYgzlwService ygzlwService;

    @PostMapping("/getAll")
    public Result getAll(){
        //查询电感生产部的
        QueryWrapper<Ygzlw> dgQueryWrapper=new QueryWrapper<>();
        dgQueryWrapper.like("zlname","电感生产");
        List<Ygzlw> dgYgzlwList=ygzlwService.list(dgQueryWrapper);
//        List<Ygzlw> ygzlwList=ygzlwService.list();
        return Result.getSuccess().setData(dgYgzlwList);
    }


}
